<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%
	String contextRoot = request.getContextPath();
%>
<f:loadBundle basename="properties.messages" var="msg"/>
<f:view>
<html>
    <head>
        <!-- Todas las paginas deben tener esta linea para que las tildes funcionen -->
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>SISDEP - Administraci<h:outputText value="#{msg.tilde_o}" />n de Tipolog<h:outputText value="#{msg.tilde_i}" />a</title>
        <link href="<%= contextRoot %>/css/estilos.css" rel="stylesheet" type="text/css" />
        <script src="<%= contextRoot %>/js/jquery/lib/jquery.js" type="text/javascript"></script>
        <script src="<%= contextRoot %>/js/jquery/jquery.validate.min.js" type="text/javascript"></script>
        <script src="<%= contextRoot %>/js/jquery/localization/messages_es.js" type="text/javascript"></script>
        <script src="<%= contextRoot %>/js/jquery.maskedinput-1.3.js" type="text/javascript"></script>
        <script src="<%= contextRoot %>/js/sisdep.js" type="text/javascript"></script>                   
    </head>
    <body>
   	<table cellspacing="0" cellpadding="0">
	  <tr>
		<td>
		<table cellspacing="0" cellpadding="0" width="100%" height="10px">
			<tr height="10px">
				<td></td>
			</tr>
		</table></td>
	  </tr>	  
	  <tr>
		<td>
		<table cellspacing="0" cellpadding="0" width="100%" height="35px">
		    <tbody>
			<tr>
			  <td class="pageTitle" style="padding-left:8px"><p>Administraci<h:outputText value="#{msg.tilde_o}" />n de Tipolog<h:outputText value="#{msg.tilde_i}" />a</p>
        	</td>
			</tr>
			</tbody>
		</table>
		</td>
	  </tr>
	  <tr align="center">
		<td height="20px" valign="top">
			<table width="100%" align="left">
			  <tr align="center" class="subtitle">
				<td colspan="5">Tipolog<h:outputText value="#{msg.tilde_i}" />a
					<br/>
				</td>
			  </tr>
			  <tr>
				<td>
				<div id="fondocontenido" style="width: 100%">					
					<h:form id="tipologiaSearchForm">
						<script type="text/javascript">
					        jQ().ready(function() {
					        	jQ("#tipologiaSearchForm").validate();
							    });
						</script>
					<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">  
						  <tr class="etiqueta">
							<td>C<h:outputText value="#{msg.tilde_o}" />digo <span class="asterisco">*</span></td>
						  </tr>
						  <tr class="datostablas">
							<td>
								<h:inputText id="codigo" size="4" maxlength="4" styleClass="required" 
										value="#{tipologiaController.tipologiaSearch.codigo}" />
							</td>
						  </tr>
						  <tr class="etiqueta">
							<td>Valor </td>
						  </tr>
						  <tr class="datostablas">
							<td>
								<h:inputText id="valor" size="60" maxlength="60" styleClass="" 
										value="#{tipologiaController.tipologiaSearch.valor}" />
							</td>
						  </tr>
					  <tr class="etiqueta">
						<td width="100%" colspan="1">
							(<span class="asterisco"> * </span>) : Campo Obligatorio. Usar % para consultar todos.
						</td>
					  </tr>
					</table>

				  	<table width="100%" border="0" cellpadding="0" cellspacing="0">
					  <tr>
						<td width="13" align="left" valign="top">
							<img src="<%= contextRoot %>/images/curvatabla1.gif" alt="curvaTabla1" width="13" height="50" />
						</td>
						<td align="center" background="<%= contextRoot %>/images/fondodowntabla.gif">
							<h:commandButton id="tipologiaSearchButton"
											 styleClass="botonsmall"
                                             type="submit" 
                                             value="Buscar" 
                                             ondblclick="return false;" 
                                             action="#{tipologiaController.searchTipologiaByKey}" >
                            </h:commandButton>
						</td>
						<td width="13" align="right" valign="top">
							<img src="<%= contextRoot %>/images/curvatabla2.gif" alt="curvaTabla2" width="13" height="50" />
						</td>
					  </tr>
					</table>
					</h:form>
					<h:form id="tipologiaResultsForm">		
					<!-- Tabla para la tabla del resultado de la consulta -->
					<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">  
					  <tr>
						<td width="100%">							
						    <h:commandButton id="createtipologiaButton"
											 styleClass="botonsmall"
                                             type="submit" 
                                             value="Nuevo" 
                                             ondblclick="return false;" 
                                             action="#{tipologiaController.createTipologia}" >
                            </h:commandButton>
						</td>
					  </tr>
					  <tr class="etiqueta">
						<td width="100%">Resultados de la Consulta de Tipolog<h:outputText value="#{msg.tilde_i}" />a:</td>
					  </tr>
					  <tr class="datostablas">
						<td>
						  <rich:dataTable id="tipologiaData" styleClass="scrollerTable" headerClass="standardTable_Header"
					                border="0" cellpadding="3" cellspacing="1" 
					                footerClass="standardTable_Header" rowKeyVar="rowIndex"
					                rowClasses="tablamultiregistrotr1,tablamultiregistrotr2"
					                onRowMouseOver="this.style.backgroundColor='#C0C0C0'"
								    onRowMouseOut="this.style.backgroundColor='#FFFFFF'"
					                var="tipologiaRow" value="#{tipologiaController.tipologiaListModel}"
					                rows="10" >
					           <h:column>
					               <f:facet name="header">
					                  <h:outputText value="EDITAR" />
					               </f:facet>
				                    <a4j:commandLink id="updateTipologia" styleClass="formTextLink"
				                                   title="Ver Detalle..."				                                   
				                                   action="#{tipologiaController.updateTipologia}" reRender="groupTable">
				                        <f:param name="tipologiaDataIndex" value="#{rowIndex}" />
				                        <h:graphicImage value="/images/edit_icon.png" style="border: 0px solid #FFFFFF;" />
				                    </a4j:commandLink>
					           </h:column>
					           <h:column>
					               <f:facet name="header" ><h:outputText value="Codigo" /></f:facet>
					               <h:outputText value="#{tipologiaRow.codigo}" />
					           </h:column>
					           <h:column>
					               <f:facet name="header" ><h:outputText value="Valor" /></f:facet>
					               <h:outputText value="#{tipologiaRow.valor}" />
					           </h:column>
					           <h:column>
					               <f:facet name="header" ><h:outputText value="Activo" /></f:facet>
					               <h:outputText value="#{tipologiaRow.activo}" />
					           </h:column>
					           <h:column>
					               <f:facet name="header" ><h:outputText value="Usuario Modifica" /></f:facet>
					               <h:outputText value="#{tipologiaRow.usuarioModifica}" />
					           </h:column>
					           <h:column>
					               <f:facet name="header" ><h:outputText value="Fecha Modifica" /></f:facet>
					               <h:outputText value="#{tipologiaRow.fechaModifica}" />
					           </h:column>
					        </rich:dataTable>
					        <h:panelGrid columns="1" styleClass="tablapaginacion"
			                             columnClasses="standardTable_ColumnCentered" >
					            <rich:datascroller id="tipologiaScroll"
					                    for="tipologiaData"
					                    fastStep="10"
					                    pageIndexVar="pageIndex"
					                    styleClass="scroller"
					                    maxPages="9" >
					                <f:facet name="first" >
					                    <h:graphicImage url="/images/arrow-first.gif" />
					                </f:facet>
					                <f:facet name="last">
					                    <h:graphicImage url="/images/arrow-last.gif" />
					                </f:facet>
					                <f:facet name="previous">
					                    <h:graphicImage url="/images/arrow-previous.gif" />
					                </f:facet>
					                <f:facet name="next">
					                    <h:graphicImage url="/images/arrow-next.gif" />
					                </f:facet>
					                <f:facet name="fastforward">
					                    <h:graphicImage url="/images/arrow-ff.gif" />
					                </f:facet>
					                <f:facet name="fastrewind">
					                    <h:graphicImage url="/images/arrow-fr.gif" />
					                </f:facet>
					            </rich:datascroller>
					        </h:panelGrid>					        
						</td>
					  </tr>
					</table>
					</h:form>					
				</div></td>
			  </tr>
			<tr align="right"" class="subtitle">
				<td colspan="5"><a href="<%= contextRoot %>/moduloRegulacion.view" target="_self" class="menuLinks">Volver al M<h:outputText value="#{msg.tilde_o}" />dulo</a></td>
			</tr>
		  </table>
	    </td>
	  </tr>
	  <tr>
		<td height="60px"></td>		
	  </tr>
	</table>	
	<%@ include file="include/validationStatus.jsp" %>
	<%@ include file="include/modalMessageWindow.jsp" %>	
    </body>
</html>
</f:view>

